/*
 * $Id: BasePostValidator.java,v 1.6 2009/07/27 21:52:19 afaichun Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.onwatch.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

public abstract class BasePostValidator implements Validator {

	/**
	 * This is an abstract class and support nothing
	 */
	public boolean supports(Class clazz) {
		return false;
	}

	public void validate(Object command, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "systemId", 
				"required.systemId", "systemId is required to identify the system");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "linkSecret", 
				"required.linkSecret", "linkSecret is required to identify the system");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "requestType", "required.requestType",
				"Request type is required to identify the request");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "iipVersion", "required.iipVersion",
				"IIP version is required to identify the system");
	}
}
